<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-model</title>
</head>

<body>
    <div id="app">
        <div>
            <input type="text" v-model="name" placeholder="姓名">
            <input type="text" v-model="age" placeholder="年龄">
            <input type="text" v-model="email" placeholder="邮箱">
            <input type="text" v-model="tel" placeholder="电话号码">
        </div>
        <div>
            <p>{{name}}</p>
            <p>{{age}}</p>
            <p>{{email}}</p>
            <p>
                <a>{{tel}}</a>
            </p>
        </div>
    </div>

    <button id="btn">改变名字</button>
    <script src="./mvvm.js"></script>
    <script>
        const app = new mvvm("#app", {
            name: "",
            age: "",
            email: "",
            tel: ""
        })
        document.querySelector('#btn').addEventListener('click', function() {
            app.setData('name', 'pandaHe')
        })
    </script>
</body>

</html>